import { Type } from 'class-transformer';
import {
  IsString,
  IsOptional,
  IsNumber,
  ValidateNested,
} from 'class-validator';

class QuantityDto {
  @IsOptional()
  @IsNumber()
  Quantity1?: number;

  @IsOptional()
  @IsNumber()
  Quantity2?: number;

  @IsOptional()
  @IsNumber()
  Quantity3?: number;

  @IsOptional()
  @IsNumber()
  Quantity4?: number;

  @IsOptional()
  @IsNumber()
  Quantity5?: number;

  @IsOptional()
  @IsNumber()
  Quantity6?: number;

  @IsOptional()
  @IsNumber()
  Quantity7?: number;

  @IsOptional()
  @IsNumber()
  Quantity8?: number;

  @IsOptional()
  @IsNumber()
  Quantity9?: number;

  @IsOptional()
  @IsNumber()
  Quantity10?: number;
}

export class CreateBillingDetailsDto {
  @IsString()
  productname: string;

  @IsString()
  @IsOptional()
  unit?: string;

  @IsNumber()
  @IsOptional()
  price?: number;

  @IsNumber()
  @IsOptional()
  additionalfee?: number;

  @IsNumber()
  @IsOptional()
  TotalQuantity?: number;

  @IsNumber()
  @IsOptional()
  TotalMoney?: number;

  @IsString()
  @IsOptional()
  ordernumber?: string;

  @IsOptional()
  @ValidateNested()
  @Type(() => QuantityDto)
  nums?: QuantityDto;
}
